package com.longtop.framework.sys.file.excel;

import java.util.List;

import com.longtop.framework.common.CacheUtil;
import com.longtop.framework.sys.codeInfo.model.TSysCodeInfo;
import com.longtop.framework.util.StringUtil;

/**
 * 用于导出Excel时，表头对应的值为codeType中对应的codeInfo的值
 * 
 * @modify:孙景弘
 */
public class CodeInfoAdapter {
	private String exportName;
	private String codeTypeId;
	private String dataFormat;
	private String fontColor;
	private String fontSize;
	private String desc;

	public String getExportName() {
		return exportName;
	}

	public void setExportName(String exportName) {
		this.exportName = exportName;
	}

	public String getCodeTypeId() {
		return codeTypeId;
	}

	public void setCodeTypeId(String codeTypeId) {
		this.codeTypeId = codeTypeId;
	}

	public String getDisplay(String value) {
		if (StringUtil.getString(value).equals("") || StringUtil.getString(codeTypeId).equals("")) {
			return "";
		}
		List<TSysCodeInfo> list = CacheUtil.getCodeInfoListByCodeTypeId(codeTypeId);
		if (list.size() <= 0) {
			return "";
		} else {
			for (TSysCodeInfo tSysCodeInfo : list) {
				if (tSysCodeInfo != null) {
					if (tSysCodeInfo.getValue().equals(value)) {
						return tSysCodeInfo.getContent();
					}
				}
			}
		}
		return "";
	}

	public String getDataFormat() {
		return dataFormat;
	}

	public void setDataFormat(String dataFormat) {
		this.dataFormat = dataFormat;
	}

	public String getFontColor() {
		return fontColor;
	}

	public void setFontColor(String fontColor) {
		this.fontColor = fontColor;
	}

	public String getFontSize() {
		return fontSize;
	}

	public void setFontSize(String fontSize) {
		this.fontSize = fontSize;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

}
